package com.example.qxfw.qxxx.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.qxfw.common.entity.qx.Water;
import com.example.qxfw.qxxx.mapper.WaterMapper;
import com.example.qxfw.qxxx.service.WaterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

@Service
public class WaterServiceImpl implements WaterService {

    @Autowired
    private WaterMapper waterMapper;

    @Override
    public List<Water> listByParams(String latestObserveTime,String location) {
        return waterMapper.selectList(Wrappers.<Water>lambdaQuery()
                .eq(Water::getLatestobservetime, Timestamp.valueOf(latestObserveTime))
                .eq(Water::getLocation,location)
                .isNotNull(Water::getWarningwaterstatus));
    }
}
